/*
 *  Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 *  This source code is licensed under the MIT license found in the LICENSE
 *  file in the root directory of this source tree.
 *
 */

/*
 *  THIS FILE IS AUTOGENERATED. DO NOT MODIFY IT; ALL CHANGES WILL BE LOST IN
 *  VAIN.
 *
 *  @generated
 */
#pragma once

#include <chrono>
#include <functional>
#include <unordered_map>

#include <folly/Range.h>

#include <mcrouter/lib/carbon/Stats.h>

#include "mcrouter/lib/carbon/test/gen/ARouteHandleIf.h"
#include "mcrouter/lib/carbon/test/gen/ARouterStats.h"

// Forward declarations
namespace folly {
struct dynamic;
class VirtualEventBase;
} // namespace folly
namespace carbon {
namespace test {
namespace A {
namespace thrift {
class A;
} // namespace thrift
} // namespace A
} // namespace test
} // namespace carbon

namespace facebook {
namespace memcache {
template <class RouteHandleIf>
class RouteHandleFactory;
namespace mcrouter {
template <class RouterInfo>
class ExtraRouteHandleProviderIf;
class ProxyBase;
} // namespace mcrouter
} // namespace memcache
} // namespace facebook

namespace carbon {
namespace test {
namespace A {

namespace detail {

using ARoutableRequests = carbon::List<
    TestARequest>;
using ARoutableReplies = carbon::List<
    TestAReply>;
using AAllRequests = carbon::List<
    TestARequest,
    facebook::memcache::McExecRequest,
    facebook::memcache::McQuitRequest,
    facebook::memcache::McShutdownRequest,
    facebook::memcache::McStatsRequest,
    facebook::memcache::McVersionRequest>;
} // namespace detail

struct ARouterInfo {
  using RouteHandleIf = ARouteHandleIf;
  using RouteHandlePtr = std::shared_ptr<RouteHandleIf>;
  using RouteHandleAsyncClient = apache::thrift::Client<carbon::test::A::thrift::A>;

  static constexpr const char* name = "A";
  static constexpr const bool bucketization = false;

  template <class Route>
  using RouteHandle = ARouteHandle<Route>;
  using RoutableRequests = detail::ARoutableRequests;
  using RoutableReplies = detail::ARoutableReplies;
  using AllRequests = detail::AAllRequests;
  
  using RouterStats = carbon::Stats<ARouterStatsConfig>;

  using RouteHandleFactoryMap = std::unordered_map<
      folly::StringPiece,
      std::function<RouteHandlePtr(
          facebook::memcache::RouteHandleFactory<RouteHandleIf>&,
          const folly::dynamic&)>,
      folly::Hash>;

  using RouteHandleFactoryMapWithProxy = std::unordered_map<
      folly::StringPiece,
      std::function<RouteHandlePtr(
          facebook::memcache::RouteHandleFactory<RouteHandleIf>&,
          const folly::dynamic&,
          facebook::memcache::mcrouter::ProxyBase&)>,
      folly::Hash>;

  using RouteHandleFactoryMapForWrapper = std::unordered_map<
      folly::StringPiece,
      std::function<RouteHandlePtr(
          RouteHandlePtr,
          facebook::memcache::mcrouter::ProxyBase&,
          const folly::dynamic&)>,
      folly::Hash>;

  static RouteHandleFactoryMap buildRouteMap();
  static RouteHandleFactoryMapWithProxy buildRouteMapWithProxy();
  static RouteHandleFactoryMapForWrapper buildRouteMapForWrapper();

  static std::unique_ptr<facebook::memcache::mcrouter::
                             ExtraRouteHandleProviderIf<ARouterInfo>>
  buildExtraProvider();
};
} // namespace A
} // namespace test
} // namespace carbon

#include "mcrouter/lib/carbon/test/gen/AThriftTransport.h"
